import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Category from '../views/Category.vue'
import NewsDetail from '../views/NewsDetail.vue'
import Favorites from '../views/Favorites.vue'
import Search from '../views/Search.vue'

const routes = [
  { path: '/', name: 'Home', component: Home },
  { path: '/category/:type', name: 'Category', component: Category },
  { path: '/news/:id', name: 'NewsDetail', component: NewsDetail },
  { path: '/favorites', name: 'Favorites', component: Favorites },
  { path: '/search', name: 'Search', component: Search }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router